package dy.spec.edu.week12_class01;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class ThirdActivity extends AppCompatActivity {
    private List<Subscrible> SubscribleList=new ArrayList<Subscrible>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_third);
        initSubscrible();
        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerView.setLayoutManager(layoutManager);
        SubscribleAdapter adapter = new SubscribleAdapter(SubscribleList);
        recyclerView.setAdapter(adapter);

        }
    private void initSubscrible(){
            Subscrible a = new Subscrible("济南 7——77...", R.drawable.dyh_10);
            SubscribleList.add(a);
            Subscrible a1 = new Subscrible("我是腾腾爸爸", R.drawable.dyh_12);
            SubscribleList.add(a1);
            Subscrible a2 = new Subscrible("川幼应用...", R.drawable.dyh_14);
            SubscribleList.add(a2);
            Subscrible a3 = new Subscrible("交易军师", R.drawable.dyh_16);
            SubscribleList.add(a3);
            Subscrible a4 = new Subscrible("品质大师", R.drawable.dyh_18);
            SubscribleList.add(a4);
    }
}